<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>三级联动</title>
    <link rel="shortcut icon" href="/favicon.ico">
</head>
<body>

<form action="" method="post">
    <select name="s1" onchange="location.href = '/u?action=cate&catesub='+this.value">
        <#list s1 as a1>
            <#if RequestParameters.catesub??>
                <#if RequestParameters.catesub==a1.id?c>
                    <option selected value="${a1.id}">${a1.name}</option>
                    <#assign my = a1.id?c>
                <#else >
                    <option value="${a1.id}">${a1.name}</option>
                </#if>
            <#else >
                <option value="${a1.id}">${a1.name}</option>
            </#if>
        </#list>
    </select>
    <select name="s2" onchange="location.href = '/u?action=cate&catesub=${my!0}&catesub2='+this.value">
        <#if s2??>
            <#list s2 as a2>
                <#if RequestParameters.catesub2??>
                    <#if RequestParameters.catesub2==a2.id?c>
                        <option selected value="${a2.id}">${a2.name}</option>
                    <#else >
                        <option value="${a2.id}">${a2.name}</option>
                    </#if>
                <#else >
                    <option value="${a2.id}">${a2.name}</option>
                </#if>
            </#list>
        </#if>
    </select>
    <#if s3??>
        <select name="s3">
            <#list s3 as a3>
                <option value="${a3.id}">${a3.name}</option>
            </#list>
        </select>
    </#if>
</form>
</body>
</html>